<!--<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script>
			window.onload = function(){
				//通过id获取
//				var oSave = document.getElementById("save");
//				var oName = document.getElementById("name");
//				var oAge = document.getElementById("age");
//				var oEdu = document.getElementById("edu");
//				var oPro = document.getElementById("pro");
//				oSave.onclick = function(){
//					var oBox = document.getElementById("box");
//					var userInfo = "姓名："+oName.value+"年龄："+oAge.value+"学历："+oEdu.value+"专业："+oPro.value;
//					oBox.innerHTML = userInfo;
//				};

		//通过tagname获取：
		//aInput 是一个数组，节点列表
//			var aInput = document.getElementsByTagName("input");
//			aInput[4].onclick = function(){
//				var oBox = document.getElementById("box");
//				var userInfo = "姓名："+aInput[0].value+"年龄："+aInput[1].value+"学历："+aInput[2].value+"专业："+aInput[3].value;
//				oBox.innerHTML = userInfo;
//			};

			//通过name
			var aInput = document.getElementsByName("name");
			aInput[4].onclick = function(){
				var oBox = document.getElementById("box");
				var userInfo = "姓名："+aInput[0].value+"年龄："+aInput[1].value+"学历："+aInput[2].value+"专业："+aInput[3].value;
				oBox.innerHTML = userInfo;
			};
		
			};
		</script>
	</head>
	<body>
		<input id="name" type="text" name="name" placeholder="姓名" />
		<input id="age" type="text" name="name" placeholder="年龄" />
		<input id="edu" type="text" name="name" placeholder="学历" />
		<input id="pro" type="text" name="name" placeholder="专业" />
		<input id="save" type="button" name="name" value="保存" />
		<br />
		<div id="box"></div>
	</body>
</html>-->
